package com.zjnx.train.rpc.impl;

import com.zjnx.train.entity.User;
import com.zjnx.train.rpc.UserRpcService;
import com.zjnx.train.service.UserService;

public class UserRpcServiceImpl implements UserRpcService {
	
	private UserService userService;

	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	@Override
	public String getNameById(Long id) {
		User user = userService.findByKey(id);
		if(null != user)
			return user.getName();
		return null;
	}

	@Override
	public User getUserById(Long id) {
		User user = userService.findByKey(id);
		return user;
	}

}
